import request from '@/utils/request'
// 获取预约列表
export const getAppointmentList = () => {
  return request.get('/appointment')
}
// 更新预约
export const updateAppointment = (data) => {
  return request.put('/appointment/updateAppointment', data)
}
// 删除预约
export const deleteAppointment = (id) => {
  return request.delete(`/appointment/deleteAppointment`,{params:{appointmentId:id}})
}
// 新增预约
export const addAppointment = (data) => {
  return request.post('/appointment/addAppointment', data)
}
//根据患者id获取预约信息
export const getAppointmentByPatientId = (patientId) => {
  return request.get('appointment/getAppointment',{params:{patientId}})
}
//支付宝支付功能
export const alipay = (data) => {
  return request.post('/pay/alipay', data)
}
//根据日期获取预约信息
export const getAppointmentByDate = () => {
  return request.get('appointment/getbyday')
}

